
package com.carsite.service.impl;

import java.util.List;

import com.carsite.service.impl.BaseManager;
import com.carsite.model.Item;
import com.carsite.dao.ItemDao;
import com.carsite.service.ItemManager;

public class ItemManagerImpl extends BaseManager implements ItemManager {
    private ItemDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setItemDao(ItemDao dao) {
        this.dao = dao;
    }

    /**
     * @see com.carsite.service.ItemManager#getItems(com.carsite.model.Item)
     */
    public List getItems(final Item item) {
        return dao.getItems(item);
    }

    /**
     * @see com.carsite.service.ItemManager#getItem(String itemId)
     */
    public Item getItem(final String itemId) {
        return dao.getItem(new Long(itemId));
    }

    /**
     * @see com.carsite.service.ItemManager#saveItem(Item item)
     */
    public void saveItem(Item item) {
        dao.saveItem(item);
    }

    /**
     * @see com.carsite.service.ItemManager#removeItem(String itemId)
     */
    public void removeItem(final String itemId) {
        dao.removeItem(new Long(itemId));
    }
}
